import java.util.*;
import java.util.function.BiConsumer;
import java.util.function.Consumer;

public class Test1 {
    public static void main(String[] args) {
//        List<Integer> list =new  ArrayList<>() ;
//        list.add(1);
//        list.add(2);
//        list.add(3);
//        list.add(4);
////        list.sort(new Comparator<Integer>() {
////            @Override
////            public int compare(Integer o1, Integer o2) {
////                return o1 - o2;
////            }
////        });
//
//        list.sort((o1,o2) -> o1.compareTo(o2));
//
//        System.out.println(list);

        Map<String , Integer> map = new HashMap<>();
        map.put("a" , 1) ;
        map.put("b" , 2) ;
        map.put("c" , 3) ;
        map.forEach(new BiConsumer<String, Integer>() {
            @Override
            public void accept(String s, Integer integer) {
                System.out.println("key:" +s+ "   val:" + integer );
            }
        });
        map.forEach((key , val) -> System.out.println("key:" +key+ "   val:" + val ));

    }
}
